precision highp float;

uniform mat4 u_MVP;
uniform mat4 u_Projection;
uniform mat4 u_View;
uniform mat4 u_headModel;

attribute vec4 a_position;
attribute vec2 a_texcoord0;

varying vec2 v_uv;

void main () {
    gl_Position = u_MVP * a_position;

    vec4 p = u_headModel * a_position;
    p = u_View * p;
    p = u_Projection * p;

    vec2 uv = p.xy / p.w;
    uv = uv * 0.5 + 0.5;

    v_uv = uv;
}
